<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<style>
    .mui_comm_head{ padding: 0; line-height: 40px; height: 40px; vertical-align: middle; }
    .mui_comm_head .comm_title { padding-top: 2px; }
</style>
<!--detail-content-->
<div class="detail-content">
    <div id="content-detail">
        <script type="text/html" id="tpl-content">
            <!--title-->
            <div class="title">
                <h2>{{resultList.title}}</h2>
                <div class="mui_comm_head">
                    <div class="comm_logo" data-id="{{resultList.unit_id}}">
                        <img src="{{resultList.unit_img}}"/>
                    </div>
                    <div class="comm_title" data-id="{{resultList.unit_id}}">
                        <a><h4 style="color: #458bd6;">{{resultList.unit_name}}</h4></a>
                        <p>{{formatTime resultList.create_time}}</p>
                    </div>
                </div>
            </div>
            <!--/title-->
            <!--content-->
            <div class="content">
                <p></p>
                <img src="{{resultList.theme_img1}}" alt="" style="margin: 10px 0;" />
                {{if resultList.abstract_info}}
                <div style="background-color: #F1F1F1; color: #666; padding: .8rem; margin-bottom: 1rem;">
                    <p style="color: #666;">{{resultList.abstract_info}}</p>
                </div>
                {{/if}}
                <p>{{#resultList.content}}</p>
            </div>
            <!--/content-->
        </script>
    </div>
</div>
<script>
    $(function(){
        $.ajax({
            url: _basePath + "app/material/detail",
            data: {id: ${id} },
            dataType: 'json',
            success: function (data) {
                if(typeof data.resultList != undefined && data.resCode == 0){
                    var _html = template('tpl-content', data);
                    $("#content-detail").append(_html).find("section").css("width", "100%");
                }else{
                    mui.toast("获取图文信息错误");
                }
            }
        });
    });
</script>